{include file="public/header" /}
<body>
<section class="main-content-wrapper">
	<section id="main-content">
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">网站设置</h3>
					</div>
					<div class="panel-body">
						<form action="/admin/system/web_info" method="post" enctype="multipart/form-data" class="form-horizontal form-border">
							<div class="form-group">
								<label class="col-sm-2 control-label">网站名称</label>
								<div class="col-sm-8">
									<input type="text" name="web_title" class="form-control" value="{$web_title}" placeholder="网站名称">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">网站优化名称</label>
								<div class="col-sm-8">
									<input type="text" name="seo_title" class="form-control" value="{$seo_title}" placeholder="网站优化名称">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">网站关键词</label>
								<div class="col-sm-8">
									<input type="text" name="web_keywords" class="form-control" value="{$web_keywords}" placeholder="网站关键词">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">网站logo：</label>
								<div class="col-sm-8">
									<div class="col-sm-8">
										<!--<input type="file" name="img">-->
										<!--<p class="help-block">建议尺寸150*100.</p>-->
										<input type="file" name="image" id="imgOne" onchange="preImg(this.id,'imgPre');" />
										<p class="help-block">建议尺寸150*100.</p>
										<img id="imgPre" src="{$web_image|default='20170208/41d9714749e66a4fdcca9faae2485c61.png'}" width="150px" height="100px" style="display: block;" />
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label label-input-sm">网站描述</label>
								<div class="col-sm-8">
									<textarea rows="6" name="web_descript" class="form-control control2">{$web_descript}</textarea>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label label-input-sm">联系方式</label>
								<div class="col-sm-8">
									<label class="col-sm-2"><input type="text" name="company" class="form-control" value="{$company}" placeholder="公司"></label>
									<label class="col-sm-2"><input type="text" name="name" class="form-control" value="{$name}" placeholder="联系人"></label>
									<label class="col-sm-2"><input type="text" name="weixin" class="form-control" value="{$weixin}" placeholder="微信号"></label>
									<label class="col-sm-2"><input type="text" name="qq" class="form-control" value="{$qq}" placeholder="QQ号"></label>
									<label class="col-sm-2"><input type="text" name="phone" class="form-control" value="{$phone}" placeholder="电话号"></label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label label-input-sm">百度token</label>
								<div class="col-sm-8">
									<input type="text" name="baidu_token" class="form-control" value="{$baidu_token}" placeholder="百度推送的token">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label label-input-sm">网站统计</label>
								<div class="col-sm-8">
									<textarea rows="6" name="tongji" class="form-control control2">{$tongji}</textarea>
								</div>
							</div>
							<div class="panel-body">
								<button type="submit" class="btn btn_5 btn-lg btn-default w_update">发布</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</section>
</section>
<script>
	/**
	 * 从 file 域获取 本地图片 url
	 */
	function getFileUrl(sourceId) {
		var url;
		if (navigator.userAgent.indexOf("MSIE")>=1) { // IE
			url = document.getElementById(sourceId).value;
		} else if(navigator.userAgent.indexOf("Firefox")>0) { // Firefox
			url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));
		} else if(navigator.userAgent.indexOf("Chrome")>0) { // Chrome
			url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));
		}
		return url;
	}
	/**
	 * 将本地图片 显示到浏览器上
	 */
	function preImg(sourceId, targetId) {
		var url = getFileUrl(sourceId);
		var imgPre = document.getElementById(targetId);
		imgPre.src = url;
	}

	//点击开启七牛云
	$(document).on('click','.tgl-btn',function(){
		if($('#cb1').is(':checked')) {
			//已经选中，点击为关闭
			$(".qiniu_status").hide();
		}else{
			//之前未选中，现在点击为开启
			$(".qiniu_status").show();
		}
	});
</script>
</body>
</html>
